{% extends "wx/base.html" %}
{% load static %}
{% load jsonify %}


{% block page_content %}
<script src="{% static 'js/fields_mb.pack.js' %}"></script>
<script type="text/javascript">

    tabs={{ tabs | jsonify | default:'[]' }}
    crt_tab = '{{ crt_tab | default:'null' }}'
    crt_tab = crt_tab || tabs[0].name

    form_logic={
        el:'#there',
        data:{
            tabs:tabs,
            crt_tab:crt_tab,
            page_label:page_label,
        },
        mixins:[field_fun],

        mounted:function(){

        },
        methods:{
            item_link:function(name){
                if(name!=this.crt_tab){
                    return ex.appendSearch({_tab:name})
                }else{
                    return 'javascript:;'
                }
            }
        }
    }
    $(function(){
        form_obj = new Vue(form_logic)
    })
</script>
{% block extra_head %}

{% endblock %}

<div id="there" v-cloak class="flex-grow" style="position: relative">



<div class="scroll-wraper">

    <div  style="text-align: center;margin:1em 0;">
        <div class="btn-group" role="group" aria-label="..." >
            <a type="button" :class="['btn btn-default',{'btn-info':crt_tab==tab.name}]" v-for="tab in tabs" :href="item_link(tab.name)" v-text="tab.label">Left</a>
        </div>
    </div>


    <!--<div class="weui-cells__title" v-text="page_label">编辑内容</div>-->

    <div class="form-pad">
        <field v-for="head in kw.heads" :name="head.name" :kw="kw"></field>
    </div>

    <div v-if="can_edit" style="text-align: center;padding: 3em 0 8em 0;">
        <a type="button" class="btn btn-success btn-sm" href="javascript:"  @click="submit()" style="width: 16em;">确定</a>
    </div>
</div>


    {% block extra_body %}

    {% endblock %}

</div>



{% endblock %}